drm/amdkfd: Fix user queue validation on Gfx7/8
authorPhilip Yang <Philip.Yang@amd.com>
Wed, 29 Jan 2025 17:37:30 +0000 (12:37 -0500)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 16 Mar 2025 21:08:59 +0000 (22:08 +0100)
commit1cd741ebf58d8fdb1dcaa09dc4edca8707af8613
tree3fd6a13a8b146d9fa33723b38799e6e3857f9e4d
parente36777fd2a9102dbe96bb01762fa4f4515cb9fdd
drm/amdkfd: Fix user queue validation on Gfx7/8

Origin: https://gitlab.freedesktop.org/drm/kernel/-/commit/e7a477735f1771b9a9346a5fbd09d7ff0641723a
Bug-Debian: https://bugs.debian.org/1093124

To workaround queue full h/w issue on Gfx7/8, when application create
AQL queue, the ring buffer bo allocate size is queue_size/2 and
map queue_size ring buffer to GPU in 2 pieces using 2 attachments, each
attachment map size is queue_size/2, with same ring_bo backing memory.

For Gfx7/8, user queue buffer validation should use queue_size/2 to
verify ring_bo allocation and mapping size.

Fixes: 68e599db7a54 ("drm/amdkfd: Validate user queue buffers")
Suggested-by: Tomáš Trnka <trnka@scm.com>
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name drm-amdkfd-Fix-user-queue-validation-on-Gfx7-8.patch
drivers/gpu/drm/amd/amdkfd/kfd_queue.c